/**
 * Copyright &copy; 2012-2014 <a href="https://github.cn.apestar">JeeSite</a> All rights reserved.
 */
package cn.apestar.modules.common.school.service;

import java.util.List;

import org.springframework.stereotype.Service;
import org.springframework.transaction.annotation.Transactional;

import cn.apestar.common.persistence.Page;
import cn.apestar.common.service.CrudService;
import cn.apestar.modules.common.school.dao.DepositDao;
import cn.apestar.modules.common.school.entity.Deposit;

/**
 * 学校Service
 * @author LVH
 * @version 2016-02-21
 */
@Service
@Transactional(readOnly = true)
public class DepositService extends CrudService<DepositDao, Deposit> {

    @Override
    public Deposit get(String id) {

        return super.get(id);
    }

    @Override
    public List<Deposit> findList(Deposit school) {

        return super.findList(school);
    }

    @Override
    public Page<Deposit> findPage(Page<Deposit> page, Deposit school) {

        return super.findPage(page, school);
    }

    @Override
    @Transactional(readOnly = false)
    public void save(Deposit school) {

        if (school.getIsNewRecord()) {
            school.preInsertInteger();
            dao.insert(school);
        } else {
            school.preUpdate();
            dao.update(school);
        }
    }

    @Override
    @Transactional(readOnly = false)
    public void delete(Deposit school) {

        super.delete(school);
    }

}